import sys
from del_uncompile import del_uncompile


def main():
    # 获取所有命令行参数（列表形式）
    args = sys.argv

    if len(args) < 4:
        print(f'缺少参数')
        return
    # 第一个参数是脚本名，后续为输入参数
    project_root = args[1]
    xts_type = args[2]
    is_del_str = args[3]

    # project_root = "../xts_hats"
    # xts_type = "hats"
    if is_del_str == "true":
        is_del = True
    elif is_del_str == "false":
        is_del = False
    else:
        print(f'is_del 请输入true/false')
        return


    xts_type_list = ['acts', 'dcts', 'hats', 'hits']
    if xts_type in xts_type_list:
        del_uncompile(project_root, xts_type, is_del)
    else:
        print(f'xts仓类型输入异常,可选参数:{xts_type_list}')
    print('finish')

if __name__ == "__main__":
    main()